/**
 * This class is used to pass the agent as a string along with the 
 * destination address to the connection manager to be sent out.
 * 
 * @author Aidan
 */
package ap;

public class AgentPkt {
	public static final char TYPE_DATAGRAM = 'D';
	public static final char TYPE_SOCKET   = 'S';
	private String destAddress;
	private int destPort;
	private char addressType;	
	private String agentString;
	
	/**
	 * default constructor
	 */
	public AgentPkt() {}
	
	
	/************************************************
	 * set methods
	 */
	public void setAgentString(String agentString) {
		this.agentString = agentString;
	}
	public void setDestType_Datagram(){
		this.addressType = TYPE_DATAGRAM;
	}
	public void setDestType_Socket(){
		this.addressType = TYPE_SOCKET;
	}
	public void setDest(String destAddress, int port){
		this.destAddress = destAddress;
		this.destPort = port;
	}
	public void setDestAddress(String destAddress) {
		this.destAddress = destAddress;
	}	
	public void setDestPort(int port){
		this.destPort = port;
	}
	
	/************************************************
	 * get methods
	 */
	public String getAgentString() {
		return this.agentString;
	}
	public byte[] getAgentByteArray(){
		return this.agentString.getBytes();
	}
	public char getAddressType(){
		return this.addressType;
	}
	public String getDest(){
		return this.destAddress + ":" + this.destPort;
	}
	public String getDestAddress() {
		return this.destAddress;
	}	
	public int getDestPort() {
		return this.destPort;
	}	
}
